package com.xhui.vimarket.zkplus.utils;

import org.zkoss.zul.Messagebox;

public class MessageBox {
    private static final String TITLE = "提示窗口";
    
    public static void alert(final String message) throws InterruptedException {
        MessageBox.alert(message, MessageBox.TITLE);
    }
    
    public static void alert(final String message, final String title) throws InterruptedException {
        Messagebox.show(message, title, Messagebox.OK, Messagebox.INFORMATION);
    }
    
    public static boolean confirm(final String message) throws InterruptedException {
        return MessageBox.confirm(message, MessageBox.TITLE);
    }
    
    public static boolean confirm(final String message, final String title)
        throws InterruptedException {
        final int ret = Messagebox.show(message, title, Messagebox.YES | Messagebox.NO,
            Messagebox.QUESTION);
        return ret == Messagebox.YES;
    }
    
    public static void error(final String message) throws InterruptedException {
        MessageBox.error(message, MessageBox.TITLE);
    }
    
    public static void error(final String message, final String title) throws InterruptedException {
        Messagebox.show(message, title, Messagebox.OK, Messagebox.ERROR);
    }
}
